/**
 * Application Name: TCSS422_WebCrawler
 * Group Name: The Other Guys
 * Members: Scott Freeman, Anthony Melcher, Jason Green
 * Date: November 10, 2011
 * 
 * Related libraries: Jericho HTML Page Parser (author unknown) 
 * 					  http://jericho.htmlparser.net/docs/index.html
 */
package model;

import java.net.URI;


/**
 * This class is a general storage structure for a
 * URL and it's associated page content, URL count,
 * and word count.
 */
public class Page {
	
	/**
	 * The HTML content of the URL
	 */
	private String my_content; 
	
	/**
	 * The parent URL seed.
	 */
	private URI my_url;
	
	/**
	 * The number of words found in the
	 * content.
	 */
	private int wordCount;
	
	/**
	 * The number of URLs found in the
	 * content.
	 */
	private int urlCount;
	
	/**
	 * The constructor for the page object containing the URL for the page and
	 * the body of the HTML from the same URL page this body includes all tags 
	 * and text. 
	 * @param content The body from the HTML page. 
	 * @param url The URL for the page 
	 */	
	public Page(final String content, final URI url) {
		
		my_content = content;
		my_url = url;
		urlCount = 0;
		wordCount = 0;
	}	
	
	/**
	 * Returns the total number of words in this page.
	 */
	public int getWordCount() {
		return wordCount;
	}
	
	/**
	 * Sets the total number of words found in this page.
	 */
	public void setWordCount(final int count) {
		wordCount = count;
	}
	
	/**
	 * Returns the total number of words in this page.
	 */
	public int getUrlCount() {
		return urlCount;
	}
	
	/**
	 * Sets the total number of words found in this page.
	 */
	public void setUrlCount(final int count) {
		urlCount = count;
	}

	/**
	 * Gets the current body from the HTML includes all tags and text.
	 * @return The current body from the HTML page including all the tags and 
	 *         text.  
	 */
	public String getMy_content() {
		return my_content;
	}

	/**
	 * Gets current URL for the page object. 
	 * @return The current URL for this page. 
	 */
	public URI getMy_url() {
		return my_url;
	}
}